package org.qs.webservice.dao.user;



import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.qs.webservice.domain.UsBookShelf;
import org.springframework.stereotype.Component;

@Component
public interface UsBookShelfMapper {
	/**
	 * 更新书架状态
	 * @param usBookShelf
	 * @return
	 */
	int updateShelfStatus(UsBookShelf usBookShelf);
	/**
	 * 删除书架
	 * @param mark_id
	 * @param user_id
	 * @return
	 */
	int deleteShelf(@Param("mark_id")Long mark_id,@Param("user_id")Long user_id);
	int deleteShelfByBookId(@Param("book_id")Long book_id,@Param("user_id")Long user_id);
	/**
	 * 分页获取书架
	 * @param pages
	 * @param contents
	 * @param user_id
	 * @return
	 */
	List<UsBookShelf> getShelf(@Param("pages")int pages,@Param("contents")int contents,@Param("user_id")Long user_id);
	int getShelfNum(@Param("user_id")Long user_id);
	/**
	 * 获取书籍的收藏数
	 * @param book_id
	 * @return
	 */
	int getShelfNumByBook(@Param("book_id")int book_id);
	
	UsBookShelf getShelfByBookIdAndUserId(@Param("book_id")int book_id,@Param("user_id")Long user_id);
}